import axios from '@/api/service.js';
import api from '@/pub/unit_api.js';

//api 统一控制api前缀

var base_url = api.api.system;
export default {
  //菜单保存
  saveMenu: user => {
    return axios.post(base_url + '/sys-menu/sysMenuEdit', user);
  },
  //删除菜单
  deleteMenu: params => {
    return axios.post(base_url + '/sys-menu/deleteMenu', params);
  },
  //菜单查询
  queryMenu: param => {
    return axios.post(base_url + '/sys-menu/queryMenu', param);
  },
  //菜单列表 树状结构
  querySysMenu: param => {
    return axios.post(base_url + '/sys-menu/querySysMenu', param);
  },
  //根据空间ID获取下拉菜单
  getMenuListBySpaceId: param => {
    return axios.post(base_url + '/sys-menu/getMenuListBySpaceId', param);
  },
  //菜单权限
  getSysMenuByAuthority: param => {
    return axios.post(base_url + '/sys-menu/getSysMenuByAuthority', param);
  },
  //菜单权限(cos)
  getCosMenuByAuthority: param => {
    return axios.post(base_url + '/sys-menu/getCosMenuByAuthority', param);
  },

  //获取显示空间
  getSysSpace: () => {
    return axios.post(base_url + '/sys-menu/getSysSpace');
  },
  //获取菜单路由
  getRoutes: () => {
    return axios.post(base_url + '/sys-menu/getRoutes');
  },
};
